<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
    public function index(){
    	$catModel = D('Admin/Cat');
    	$this->assign('cattree',$catModel->gettree());

    	$goodsModel = D('Admin/goods');

    	$all = 'goods_id,goods_name,shop_price,goods_img,market_price';
    	
    	//热销商品
    	$hot = $goodsModel->field($all)->where('is_hot=1')->order('goods_id desc')->limit('0,4')->select();
   	    $this->assign('hot',$hot);

   	    //精品推荐
   	    $best = $goodsModel->field($all)->where('is_best')->order('goods_id asc')->limit('0,4')->select();
   	    $this->assign('best',$best);
   	    
   	    //新品上市
   	    $new = $goodsModel->field($all)->where('is_new')->order('goods_id desc')->limit('0,4')->select();
   	    $this->assign('new',$new);
   	    $this->display();
    }
}